{template '_header'}

    <div class="page-header">
        当前位置：<span class="text-primary">服务人员管理</span>
    </div>
<div class="page-content" style="display: block;">
    <form action="./index.php" method="get" class="form-horizontal form-search" role="form">
        <input type="hidden" name="c" value="site" />
        <input type="hidden" name="a" value="entry" />
        <input type="hidden" name="m" value="mx_shop" />
        <input type="hidden" name="do" value="web" />
        <input type="hidden" name="r" value="store.staff" />
        <div class="page-toolbar">
            <div class="col-sm-6">
                <div class="input-group-btn">
                    {ifp 'store.staff.add'}
                    <a class="btn btn-primary btn-sm"   href="{php echo webUrl('store/staff/add');}">添加服务人员</a>
                    {/if}
                </div>
            </div>
            <div class="col-sm-6 pull-right">
                <div class="input-group">
                    <input type="text" class="input-sm form-control" name='keyword' value="{$_GPC['keyword']}" placeholder="姓名/昵称/门店ID/门店名称">
                    <span class="input-group-btn">
                        <button class="btn btn-primary" type="submit"> 搜索</button>
                    </span>
                </div>

            </div>
        </div>
    </form>
    {if count($list)>0}
    <div class="page-table-header">
        <input type="checkbox">
        <div class="btn-group">
            {ifp 'store.staff.edit'}
            <button class="btn btn-default btn-sm btn-operation" type="button" data-toggle="batch" data-href="{php echo webUrl('store/staff/setstatus',array(status=>1))}" disabled="disabled">
                <i class="icow icow-jinyong"></i> 禁用
            </button>
            <button class="btn btn-default btn-sm btn-operation" type="button" data-toggle="batch" data-href="{php echo webUrl('store/staff/setstatus',array(status=>0))}" disabled="disabled">
                <i class="icow icow-qiyong"></i> 启用
            </button>
            {/if}
            {ifp 'store.staff.delete'}
            <button class="btn btn-default btn-sm btn-operation" type="button" data-toggle="batch-remove" data-confirm="确认要删除吗?" data-href="{php echo webUrl('store/staff/delete')}" disabled="disabled">
                <i class="icow icow-shanchu1"></i> 删除
            </button>
            {/if}
        </div>
    </div>
    <table class="table table-hover table-responsive">
        <thead class="navbar-inner">
        <tr>
            <th style="width:25px;"></th>
            <th style="width:60px;text-align:center;">排序</th>
            <th>昵称</th>
            <th style="width:80px;">姓名</th>
            <th style="width:90px;">性别</th>
            <th style="width:90px;">所属门店</th>
            <th style="width:100px;">手机号</th>
            <th style="width:60px;">状态</th>
            <th style="width: 70px;">操作</th>
        </tr>
        </thead>
        <tbody>
        {loop $list $v}
        <tr>
            <td><input type='checkbox'   value="{$v['id']}"/></td>
            <td style="text-align:center;">
                <a href="javascript:;" data-toggle="ajaxEdit" data-href="{php echo webUrl('store/staff/setdisplayorder',array('id'=>$v['id']));}">{$v['displayorder']}</a>
            </td>
            <td><img src="{php echo tomedia($v['avatar'])}" style="width:40px;height:40px;padding:1px;border:1px solid #ccc;margin-right: 10px" onerror="this.src='../addons/mx_shop/static/images/nopic.png'"/>{$v['nickname']}</td>
            <td>
                {$v['realname']}
            </td>
            <td>
                {if empty($v['sex'])}男{else}女{/if}
            </td>
            <td>
                {$v['storename']}
            </td>
            <td>
                {$v['mobile']}
            </td>
            <td>

                {ifp 'store.staff.edit'}
                <span class='label {if $v['status']==1}label-primary{else}label-default{/if}'
                data-toggle='ajaxSwitch'
                data-confirm = "确认{if $v['status']==1}禁用{else}启用{/if}？"
                data-switch-refresh='true'
                data-switch-value='{$v['status']}'
                data-switch-value0='0|禁用|label label-default|{php echo webUrl('store/staff/setstatus',array('status'=>0,'id'=>$v['id']))}'
                data-switch-value1='1|启用|label label-primary|{php echo webUrl('store/staff/setstatus',array('status'=>1,'id'=>$v['id']))}'
                >
                {if $v['status']==1}启用{else}禁用{/if}</span>
                {/if}
            </td>
            <td style="overflow:visible;position:relative">

                {ifp 'store.staff.edit'}
                    <a class='btn btn-default  btn-sm btn-op btn-operation' href="{php echo webUrl('store/staff/edit', array('id' => $v['id']))}">
                         <span data-toggle="tooltip" data-placement="top" title="" data-original-title="编辑">
                             <i class='icow icow-bianji2'></i>
                        </span>
                    </a>
                {/if}
                {ifp 'store.staff.delete'}
                    <a class="btn btn-default btn-sm btn-op btn-operation" data-toggle="ajaxRemove" href="{php echo webUrl('store/staff/delete',array('id'=>$v['id']));}" data-confirm="确认删除此商品？">
                         <span data-toggle="tooltip" data-placement="top" title="" data-original-title="删除">
                             <i class='icow icow-shanchu1'></i>
                        </span>
                    </a>
                {/if}
            </td>
        </tr>
        {/loop}
        </tbody>
        <tfoot>
            <tr>
                <td><input type="checkbox"></td>
                <td colspan="2">
                    {ifp 'store.staff.edit'}
                    <button class="btn btn-default btn-sm btn-operation" type="button" data-toggle="batch" data-href="{php echo webUrl('store/staff/setstatus',array(status=>1))}" disabled="disabled">
                        <i class="icow icow-jinyong"></i> 禁用
                    </button>
                    <button class="btn btn-default btn-sm btn-operation" type="button" data-toggle="batch" data-href="{php echo webUrl('store/staff/setstatus',array(status=>0))}" disabled="disabled">
                        <i class="icow icow-qiyong"></i> 启用
                    </button>
                    {/if}
                    {ifp 'store.staff.delete'}
                    <button class="btn btn-default btn-sm btn-operation" type="button" data-toggle="batch-remove" data-confirm="确认要删除吗?" data-href="{php echo webUrl('store/staff/delete')}" disabled="disabled">
                        <i class="icow icow-shanchu1"></i> 删除
                    </button>
                    {/if}
                </td>
                <td colspan="6" class="text-right">
                    {$pager}
                </td>
            </tr>
        </tfoot>
    </table>
    {else}
    <div class='panel panel-default'>
        <div class='panel-body' style='text-align: center;padding:30px;'>
            暂时没有任何服务人员!
        </div>
    </div>
    {/if}

</div>
{template '_footer'}